﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TCEasyPrintRev.Models;

namespace TCEasyPrintRev.Controllers
{ 
    public class BahanController 
    {
        
        public static double getHarga(string id)
        {

            using (var session = CRUD<Bahan>.load().OpenSession())
            {
                return  session.QueryOver<Bahan>().List().Where(x => x.ID == id).
                Select(x => x.Harga).ToList().Last();

               
            }
        }

        public static string getNama(string id)
        {
            using (var session = CRUD<Bahan>.load().OpenSession())
            {
                return session.QueryOver<Bahan>().List().Where(x => x.ID == id).
                Select(x => x.Nama).ToList().Last();
            }
        }
    }
}